/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ExitAskFrame.java
 *
 * Created on 14.11.2009, 12:28:53
 */

package iddsgui;

import Main.Parameters;

/**
 *
 * @author zem
 */
public class ExitAskFrame extends javax.swing.JFrame {

    private static ExitAskFrame instance;
    /** Creates new form ExitAskFrame */
    public ExitAskFrame() {
        initComponents();

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        No_Button = new javax.swing.JButton();
        Yes_Button = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        TextPane = new javax.swing.JTextPane();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);

        No_Button.setText(Parameters.GUI_ExitAskFrame_NoButton);
        No_Button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                No_ButtonActionPerformed(evt);
            }
        });

        Yes_Button.setText(Parameters.GUI_ExitAskFrame_YesButton);
        Yes_Button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Yes_ButtonActionPerformed(evt);
            }
        });

        TextPane.setText(Parameters.GUI_ExitAskFrame_Message);
        jScrollPane1.setViewportView(TextPane);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(No_Button, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(Yes_Button, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(No_Button)
                    .addComponent(Yes_Button))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * Dispose window when user clicks NO button;
     * @param evt
     */
    private void No_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_No_ButtonActionPerformed
        dispose();
    }//GEN-LAST:event_No_ButtonActionPerformed

    /**
     * Exit IDDS when user clicks YES button;
     * @param evt
     */
    private void Yes_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Yes_ButtonActionPerformed
        Parameters.exit=true;
    }//GEN-LAST:event_Yes_ButtonActionPerformed

    /**
    * @param args the command line arguments
    */
    public void main() {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                instance=new ExitAskFrame();
                instance.setTitle(Parameters.GUI_ExitAskFrame_Title);
                instance.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton No_Button;
    private javax.swing.JTextPane TextPane;
    private javax.swing.JButton Yes_Button;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables

}
